package com.artist.service.Impl;

import com.artist.entity.TbList;
import com.artist.mapper.ListMapper;
import com.artist.service.ListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("listService")
public class ListServiceImpl implements ListService {
    @Autowired
    private ListMapper listMapper;
    @Override
    public List<TbList> allList() {
        return listMapper.selectAll();
    }

    @Override
    public void saveList(TbList tbList) {
        listMapper.insertSelective(tbList);
    }

    @Override
    public void updateList(TbList tbList) {
        listMapper.updateByPrimaryKeySelective(tbList);

    }

    @Override
    public TbList selectByPrimaryKey(Long listId) {
        return listMapper.selectByPrimaryKey(listId);
    }

    @Override
    public void deleteList(Long listId) {
        listMapper.deleteByPrimaryKey(listId);
    }
}
